import { useRouter } from 'vue-router';

export const sendMessage = (id: number, arr: any[]) => {
  const router = useRouter();
  const message = arr.filter((item: any) => item.id === id)[0]?.message || '';
  const type = 'QuestionGenerator'; // 根据需求调整 type
  router.push({
    name: 'chat',
    query: {
      type: type,
      message: message
    }
  });
};